#!/bin/bash -e

function info() {
echo Usage: `basename $0` 'bed.prefix sample_ids'
exit 1
}

while getopts  ":p:f:i:d:" opt; do
case  $opt  in
    p) out_prefix=$OPTARG;;
    f) suffix=$OPTARG;;
    i) bed=$OPTARG;;
    d) depth_filter=$OPTARG;;
    *) info;;
esac
done
shift $(($OPTIND - 1))


if [ $# -lt 1 ]; then info; fi

. $var

prefix2=$1
ids=$2

plink --bfile $prefix2 --keep-fam $ids --out $out_prefix.target --make-bed
# plink --bfile 11.merge --bmerge 11.1.bed 11.1.bim 11.1.fam --extract list.snps --make-bed --out merge

# plink --bfile 11.merge --bmerge 11.1.bed 11.1.bim 11.1.fam --make-bed --out merge

. $cmd_done